|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
GenerationFault.java | 0% | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.toWs;
|
|
18 |
|
|
19 |
/**
|
|
20 |
* <p>This denotes the Exception occured at the code genaration.
|
|
21 |
* There is a isssue of wrapping the Exception such that JDK1.3 compatibility.
|
|
22 |
* This code write same way as it was done at the RemoteException.</p>
|
|
23 |
*/
|
|
24 |
public class GenerationFault extends Exception { |
|
25 |
/**
|
|
26 |
* Nested Exception to hold wrapped exception.
|
|
27 |
* <p>This field predates the general-purpose exception chaining facility.
|
|
28 |
* The {@link Throwable#getCause()} method is now the preferred means of
|
|
29 |
* obtaining this information.
|
|
30 |
*
|
|
31 |
* @serial
|
|
32 |
*/
|
|
33 |
public Throwable detail;
|
|
34 |
|
|
35 | 0 |
private GenerationFault(Exception e) {
|
36 | 0 |
initCause(null); // Disallow subsequent initCause |
37 | 0 |
setStackTrace(e.getStackTrace()); |
38 | 0 |
detail = e; |
39 |
} |
|
40 |
|
|
41 | 0 |
public GenerationFault(String message) {
|
42 | 0 |
super(message);
|
43 |
} |
|
44 |
|
|
45 |
/**
|
|
46 |
* Constructs a <code>Exception</code> with the specified
|
|
47 |
* detail message and nested exception.
|
|
48 |
*
|
|
49 |
* @param s the detail message
|
|
50 |
* @param ex the nested exception
|
|
51 |
*/
|
|
52 | 0 |
public GenerationFault(String s, Throwable ex) {
|
53 | 0 |
initCause(null); // Disallow subsequent initCause |
54 | 0 |
detail = ex; |
55 | 0 |
setStackTrace(ex.getStackTrace()); |
56 |
} |
|
57 |
|
|
58 |
/**
|
|
59 |
* Returns the detail message, including the message from the nested
|
|
60 |
* exception if there is one.
|
|
61 |
*
|
|
62 |
* @return the detail message, including nested exception message if any
|
|
63 |
*/
|
|
64 | 0 |
public String getMessage() {
|
65 | 0 |
if (detail == null) { |
66 | 0 |
return super.getMessage(); |
67 |
} else {
|
|
68 | 0 |
return detail.getMessage();
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
/**
|
|
73 |
* Returns the wrapped exception (the <i>cause</i>).
|
|
74 |
*
|
|
75 |
* @return the wrapped exception, which may be <tt>null</tt>.
|
|
76 |
*/
|
|
77 | 0 |
public Throwable getCause() {
|
78 | 0 |
return detail;
|
79 |
} |
|
80 |
|
|
81 | 0 |
public static GenerationFault createGenerationFault(Exception e) { |
82 | 0 |
if (e instanceof GenerationFault) { |
83 | 0 |
return (GenerationFault) e;
|
84 |
} else
|
|
85 | 0 |
return new GenerationFault(e); |
86 |
} |
|
87 |
} |
|
88 |
|
|